#include <stdio.h>
#include <math.h>
#include <stdlib.h>

int main ( int argc, char const *argv[] ) {
    int num = 5;
    int i = 2;
    int isPrime = 1;
    int cnt = 2;
    printf("2\t3\t");
    for ( num = 5; num < 101; num++ ) {
        for ( i = 2; i <= sqrt(num); i++ ) {
            if ( num % i == 0 ) {
                isPrime = 0;
                break;
            }
        }
        if ( isPrime == 0 ) {
            isPrime = 1;
        } else {printf("%d\t",num);
        cnt++;
        if ( cnt == 6 ) {
            printf("\n");
            cnt = 0;
        }
        }
    }
    return EXIT_SUCCESS;
}